package cn.cleanarch.infra.idp.pms.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import cn.cleanarch.infra.idp.database.entity.DBModel;
import org.hibernate.validator.constraints.Length;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 设计文件版本实体类
 */
@Data
@ToString
@EqualsAndHashCode(callSuper = true)
@TableName("t_design_file_version")
public class DesignFileVersion extends DBModel {

    /**
     * 文件ID
     */
    @TableField("file_id")
    private Long fileId;

    /**
     * 版本号
     */
    @TableField("version_number")
    @Length(max = 20)
    private String versionNumber;

    /**
     * 版本描述
     */
    @TableField("description")
    @Length(max = 500)
    private String description;

    /**
     * 文件键名(存储路径)
     */
    @TableField("file_key")
    @Length(max = 500)
    private String fileKey;

    /**
     * 文件大小(字节)
     */
    @TableField("file_size")
    private Long fileSize;

    /**
     * 文件类型
     */
    @TableField("file_type")
    @Length(max = 50)
    private String fileType;

    /**
     * 文件MD5
     */
    @TableField("file_md5")
    @Length(max = 64)
    private String fileMd5;

    /**
     * 文件状态(NORMAL:正常, DELETED:已删除)
     */
    @TableField("status")
    @Length(max = 20)
    private String status;

    /**
     * 版本状态(ACTIVE:激活, ARCHIVED:归档)
     */
    @TableField("version_status")
    @Length(max = 20)
    private String versionStatus;

    /**
     * 操作类型(CREATE:创建, UPDATE:更新, RESTORE:恢复)
     */
    @TableField("operation_type")
    @Length(max = 20)
    private String operationType;

    /**
     * 操作用户ID
     */
    @TableField("operator_id")
    private Long operatorId;

    /**
     * 安全状态(UNSCANNED:未扫描, SAFE:安全, UNSAFE:不安全, PENDING:等待扫描)
     */
    @TableField("security_status")
    @Length(max = 20)
    private String securityStatus;

    /**
     * 最后访问时间
     */
    @TableField("last_access_time")
    private Long lastAccessTime;

    /**
     * 存储状态(UPLOADING:上传中, STORED:已存储, FAILED:上传失败, DELETED:已删除)
     */
    @TableField("storage_status")
    @Length(max = 20)
    private String storageStatus;

    /**
     * 创建者ID
     */
    @TableField("created_by")
    private Long createdBy;

    /**
     * 更新者ID
     */
    @TableField("updated_by")
    private Long updatedBy;

}